<template>
  <div>
    <group label-width="4.5em" label-margin-right="2em" label-align="right">
      <x-input title="紧急程度" v-model="value1" :required="true"></x-input>
       <popup-picker title="发货计划人*" placeholder="请选择" :data="list" v-model="value6" value-text-align="left" :required="true"></popup-picker>
     <x-textarea title="总询价内容" placeholder="请填写总询价内容（选填）" :show-counter="false" :rows="2"></x-textarea>
      <x-address title="发货地址*" v-model="FaddressValue" raw-value :list="addressData" value-text-align="left" :required="true"></x-address>
       <x-textarea title="详细信息*" placeholder="请填写详细地址" :show-counter="false" :rows="2" :required="true"></x-textarea>
       <x-address title="送货地址*" v-model="SaddressValue" raw-value :list="addressData" value-text-align="left" :required="true"></x-address>
        <x-textarea title="详细信息*" placeholder="请填写详细地址" :show-counter="false" :rows="2" :required="true"></x-textarea>
      <datetime title="预计发货时间*" v-model="time1" value-text-align="left" :required="true" :min-year=2017 :max-year=2017 format="YYYY-MM-DD HH:mm" @on-change="change" year-row="{value}年" month-row="{value}月" day-row="{value}日" hour-row="{value}点" minute-row="{value}分" confirm-text="完成" cancel-text="取消"></datetime>
    <datetime title="预计到货时间*" v-model="time2" value-text-align="left" :required="true" :min-year=2017 :max-year=2017 format="YYYY-MM-DD HH:mm" @on-change="change" year-row="{value}年" month-row="{value}月" day-row="{value}日" hour-row="{value}点" minute-row="{value}分" confirm-text="完成" cancel-text="取消"></datetime>
      <popup-picker title="货物类别*" placeholder="请选择" :data="goodstypes" v-model="value5" value-text-align="left" :required="true"></popup-picker>
    </group>
     <box gap="10px 10px">
       <x-button :text="submit001" :disabled="disable001" @click.native="processButton001" type="primary">发  布</x-button>
       </box>
  </div>
</template>

<script>
  import { Group, Cell, XInput, Selector, PopupPicker, Datetime, XNumber, ChinaAddressData, XAddress, XTextarea, Box, XButton } from 'vux'
  export default {
    components: {
      Group,
      Cell,
      XInput,
      Selector,
      PopupPicker,
      XAddress,
      Datetime,
      XNumber,
      XTextarea,
      Box,
      XButton
    },
  computed: {
     title () {
        return '询价发布'
    }
  },
    data () {
      return {
        addressData: ChinaAddressData,
        FaddressValue: [],
        SaddressValue: [],
        value1: '',
        value3: '',
        value7: '',
        value8: '',
        value4: '',
        time1: '',
        time2: '',
        value5: [],
        goodstypes: [['钢铁','铝片','生铁']],
        value6: [],
        list: [['计划1', '张杨', '丁丹丹']],
        numberValue: 0,
        submit001: 'click me',
      disable001: false
      }
    },
  methods: {
    toggleFormat () {
      this.format = this.format === 'YYYY-MM-DD HH:mm' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm'
    },
    reRender () {
      this.startDate = '2016-11-11'
      this.endDate = '2018-10-11'
    },
    change (value) {
      console.log('change', value)
    },
    clearValue (value) {
      this.$data.value6 = ''
    },
    clearValue8 (value) {
      this.$data.value8 = ''
    },
    setToday (value) {
      let now = new Date()
      let cmonth = now.getMonth() + 1
      let day = now.getDate()
      if (cmonth < 10) cmonth = '0' + cmonth
      if (day < 10) day = '0' + day
      this.$data.value7 = now.getFullYear() + '-' + cmonth + '-' + day
      console.log('set today ok')
    },
    processButton001 () {
      this.submit001 = 'processing'
      this.disable001 = true
    }
  }
  }
</script>

<style>

.weui-label{
  width:5.5em!important;
}

</style>

